package com.test1224;

public class Test04 {
    public static void main(String[] args) {
        // 求数组arr中元素之和
        int[] arr = {6, 1, 7, 4, 3};
        int sum=0;
        for(int i=0;i<arr.length;i++){
            sum +=arr[i];
        }
        System.out.println("数组元素之和为"+sum);
    }
}
